<?php

	
	
	function databaseObjectFactory($quaryType, $tableName) {
		checkFunctionName($quaryType);
		checkTableName($tableName);
		$name     = ucfirst($quaryType) . ucfirst($tableName);
		return new $name();
	}
	
	function checkFunctionName($functionName) {
		switch ($functionName) {
			case "delete":
				break;
			case "select":
				break;
			case "update":
				break;
			default:
				throw new UnexpectedValueException("No such Function Name");
				break;
		}
	}
	
	function checkTableName($tableName) {
		switch ($tableName) {
			case "stocks":
				break;
			case "users":
				break;
			case "paths":
				break;
			case "category":
				break;
			default:
				throw new UnexpectedValueException("No such Table Name");
				break;
		}
	}

?>